package com.xiaotu.storage;

import java.util.Date;

import org.springframework.stereotype.Component;

import com.xiaotu.common.util.Constants;
import com.xiaotu.common.util.DataRedisKeyUtils;
import com.xiaotu.common.util.Constants.DataRedisKey;

import net.sf.json.JSONObject;

/**
 * @类名 StarWBStorageProcessor
 * @日期 2017年3月1日
 * @作者 高海军
 * @功能 艺人微博数据转储
 */
@Component("StarWBStorageProcessor")
public class StarWBStorageProcessor extends TVWBStorageProcessor
{
	@Override
	protected void validateData(JSONObject target)
	{
		this.validateAllNotEmpty(target, "starId", "name", "fans",
				"readFrequency", "commentFrequency", "weiboType");
	}
	
	@Override
	protected String[] getFields()
	{
		return new String[] { "starId", "name", "fans", "readFrequency",
				"commentFrequency", "weibo", "concern", "weiboType",
				"timestamp" };
	}
	
	@Override
	public String getTaskType()
	{
		return Constants.SpiderTaskType.WEIBO_STAR;
	}
	
	@Override
	protected String getRedisKey(Date date)
	{
		return DataRedisKeyUtils.getKey(DataRedisKey.Star_Weibo_YYYYMMDD, date);
	}
}
